#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_StringBuf
#include <StringBuf.h>
#endif
#ifndef INCLUDED_cpp_CppInt32__
#include <cpp/CppInt32__.h>
#endif
#ifndef INCLUDED_jax_lang_JCharSequence
#include <jax/lang/JCharSequence.h>
#endif
#ifndef INCLUDED_jax_lang_JString
#include <jax/lang/JString.h>
#endif
#ifndef INCLUDED_jax_lang_JStringBuilder
#include <jax/lang/JStringBuilder.h>
#endif
namespace jax{
namespace lang{

Void JStringBuilder_obj::__construct(Dynamic f)
{
{
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",10)
	this->_native = ::StringBuf_obj::__new();
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",11)
	if (((bool((f != null())) && bool(::Std_obj::is(f,hx::ClassOf< ::jax::lang::JCharSequence >()))))){
		HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",12)
		::StringBuf _this = this->_native;
		HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",12)
		hx::IndexRef((_this->b).mPtr,_this->b->__Field(HX_CSTRING("length"),true)) = f->toString();
	}
	else{
		HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",13)
		if ((::Std_obj::is(f,hx::ClassOf< ::String >()))){
			HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",14)
			::StringBuf _this = this->_native;
			HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",14)
			hx::IndexRef((_this->b).mPtr,_this->b->__Field(HX_CSTRING("length"),true)) = f;
		}
	}
}
;
	return null();
}

JStringBuilder_obj::~JStringBuilder_obj() { }

Dynamic JStringBuilder_obj::__CreateEmpty() { return  new JStringBuilder_obj; }
hx::ObjectPtr< JStringBuilder_obj > JStringBuilder_obj::__new(Dynamic f)
{  hx::ObjectPtr< JStringBuilder_obj > result = new JStringBuilder_obj();
	result->__construct(f);
	return result;}

Dynamic JStringBuilder_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JStringBuilder_obj > result = new JStringBuilder_obj();
	result->__construct(inArgs[0]);
	return result;}

hx::Object *JStringBuilder_obj::__ToInterface(const type_info &inType) {
	if (inType==typeid( ::jax::lang::JCharSequence_obj)) return operator ::jax::lang::JCharSequence_obj *();
	return super::__ToInterface(inType);
}

::jax::lang::JStringBuilder JStringBuilder_obj::append( Dynamic d){
	HX_SOURCE_PUSH("JStringBuilder_obj::append")
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",17)
	{
		HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",17)
		::StringBuf _this = this->_native;
		HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",17)
		hx::IndexRef((_this->b).mPtr,_this->b->__Field(HX_CSTRING("length"),true)) = d;
	}
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",18)
	return hx::ObjectPtr<OBJ_>(this);
}


HX_DEFINE_DYNAMIC_FUNC1(JStringBuilder_obj,append,return )

int JStringBuilder_obj::charAt( ::cpp::CppInt32__ ind){
	HX_SOURCE_PUSH("JStringBuilder_obj::charAt")
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",20)
	return this->_native->b->__Field(HX_CSTRING("join"),true)(HX_CSTRING(""))->__Field(HX_CSTRING("charCodeAt"),true)(::cpp::CppInt32___obj::toInt(ind));
}


HX_DEFINE_DYNAMIC_FUNC1(JStringBuilder_obj,charAt,return )

int JStringBuilder_obj::length( ){
	HX_SOURCE_PUSH("JStringBuilder_obj::length")
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",23)
	return this->_native->b->__Field(HX_CSTRING("join"),true)(HX_CSTRING(""))->__Field(HX_CSTRING("length"),true);
}


HX_DEFINE_DYNAMIC_FUNC0(JStringBuilder_obj,length,return )

::String JStringBuilder_obj::toString( ){
	HX_SOURCE_PUSH("JStringBuilder_obj::toString")
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",26)
	return this->_native->b->__Field(HX_CSTRING("join"),true)(HX_CSTRING(""));
}


HX_DEFINE_DYNAMIC_FUNC0(JStringBuilder_obj,toString,return )

::jax::lang::JCharSequence JStringBuilder_obj::subSequence( ::cpp::CppInt32__ s,::cpp::CppInt32__ e){
	HX_SOURCE_PUSH("JStringBuilder_obj::subSequence")
	HX_SOURCE_POS("Source/jax/lang/JStringBuilder.hx",29)
	return ::jax::lang::JString_obj::__new(this->toString().substr(::cpp::CppInt32___obj::toInt(s),::cpp::CppInt32___obj::toInt(::cpp::CppInt32___obj::sub(e,s))));
}


HX_DEFINE_DYNAMIC_FUNC2(JStringBuilder_obj,subSequence,return )


JStringBuilder_obj::JStringBuilder_obj()
{
}

void JStringBuilder_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JStringBuilder);
	HX_MARK_MEMBER_NAME(_native,"_native");
	HX_MARK_END_CLASS();
}

void JStringBuilder_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(_native,"_native");
}

Dynamic JStringBuilder_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 6:
		if (HX_FIELD_EQ(inName,"append") ) { return append_dyn(); }
		if (HX_FIELD_EQ(inName,"charAt") ) { return charAt_dyn(); }
		if (HX_FIELD_EQ(inName,"length") ) { return length_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"_native") ) { return _native; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"subSequence") ) { return subSequence_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JStringBuilder_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 7:
		if (HX_FIELD_EQ(inName,"_native") ) { _native=inValue.Cast< ::StringBuf >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JStringBuilder_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("_native"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("_native"),
	HX_CSTRING("append"),
	HX_CSTRING("charAt"),
	HX_CSTRING("length"),
	HX_CSTRING("toString"),
	HX_CSTRING("subSequence"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JStringBuilder_obj::__mClass,"__mClass");
};

Class JStringBuilder_obj::__mClass;

void JStringBuilder_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.lang.JStringBuilder"), hx::TCanCast< JStringBuilder_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JStringBuilder_obj::__boot()
{
}

} // end namespace jax
} // end namespace lang
